package com.ruoyi.mall.sms.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mall.sms.domain.SmsFlashPromotionSession;
import com.ruoyi.mall.sms.mapper.SmsFlashPromotionSessionMapper;
import com.ruoyi.mall.sms.service.ISmsFlashPromotionSessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 限时购场次Service业务层处理
 *
 * @author xuxing
 * @date 2021-02-09
 */
@Service
public class SmsFlashPromotionSessionServiceImpl implements ISmsFlashPromotionSessionService
{
    @Autowired
    private SmsFlashPromotionSessionMapper smsFlashPromotionSessionMapper;

    /**
     * 查询限时购场次
     *
     * @param id 限时购场次ID
     * @return 限时购场次
     */
    @Override
    public SmsFlashPromotionSession selectSmsFlashPromotionSessionById(Long id)
    {
        return smsFlashPromotionSessionMapper.selectSmsFlashPromotionSessionById(id);
    }

    /**
     * 查询限时购场次列表
     *
     * @param smsFlashPromotionSession 限时购场次
     * @return 限时购场次
     */
    @Override
    public List<SmsFlashPromotionSession> selectSmsFlashPromotionSessionList(SmsFlashPromotionSession smsFlashPromotionSession)
    {
        return smsFlashPromotionSessionMapper.selectSmsFlashPromotionSessionList(smsFlashPromotionSession);
    }

    /**
     * 新增限时购场次
     *
     * @param smsFlashPromotionSession 限时购场次
     * @return 结果
     */
    @Override
    public int insertSmsFlashPromotionSession(SmsFlashPromotionSession smsFlashPromotionSession)
    {
        smsFlashPromotionSession.setCreateTime(DateUtils.getNowDate());
        return smsFlashPromotionSessionMapper.insertSmsFlashPromotionSession(smsFlashPromotionSession);
    }

    /**
     * 修改限时购场次
     *
     * @param smsFlashPromotionSession 限时购场次
     * @return 结果
     */
    @Override
    public int updateSmsFlashPromotionSession(SmsFlashPromotionSession smsFlashPromotionSession)
    {
        return smsFlashPromotionSessionMapper.updateSmsFlashPromotionSession(smsFlashPromotionSession);
    }

    /**
     * 批量删除限时购场次
     *
     * @param ids 需要删除的限时购场次ID
     * @return 结果
     */
    @Override
    public int deleteSmsFlashPromotionSessionByIds(Long[] ids)
    {
        return smsFlashPromotionSessionMapper.deleteSmsFlashPromotionSessionByIds(ids);
    }

    /**
     * 删除限时购场次信息
     *
     * @param id 限时购场次ID
     * @return 结果
     */
    @Override
    public int deleteSmsFlashPromotionSessionById(Long id)
    {
        return smsFlashPromotionSessionMapper.deleteSmsFlashPromotionSessionById(id);
    }
}
